

<style>
    .modal-dialog{width:900px!important;}
    .layui-form{padding:15px 0px}
    .layui-form label{text-align: justify;text-align-last: justify}
    .layui-form-radio{margin: 0px 0px 0 0;padding-right:0px;line-height:10px;}
    .layui-form-radio>i{font-size:16px;margin-right:5px}
    .zxd_status{margin-right:8px}
    .zxd_img{width:80px;max-height:150px;}
    .content_img img{width:80px;max-height:150px;}
</style>

<div class="modal-body">


    <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" close="true">
            <span aria-hidden="true">×</span>
        </button>
        <h4 class="modal-title">
            <span class="fa fa-legal"></span>&nbsp;详细信息
        </h4>
    </div>

    <form class="form-horizontal layui-form content_main">


        <div class="form-group">
            <label class="col-sm-2 control-label">用户名称</label>
            <div class="col-sm-10 content_div">
                {$detail.name}
            </div>
        </div>

        <div class="form-group">
            <label class="col-sm-2 control-label">联系方式</label>
            <div class="col-sm-10 content_div">
                {$detail.mobile}
            </div>
        </div>

        <div class="form-group">
            <label class="col-sm-2 control-label">标题</label>
            <div class="col-sm-10 content_div">
                {$detail.title}
            </div>
        </div>

        <div class="form-group">
            <label class="col-sm-2 control-label">内容</label>
            <div class="col-sm-10 content_div">
                {$detail.content}
            </div>
        </div>

        <div class="form-group">
            <label class="col-sm-2 control-label">图片组</label>
            <div class="col-sm-10 content_div content_img">
                {volist name="images" id="vo"}
                   <a href="{$vo}" target="_blank"><img src="{$vo}" ></a>
                {/volist}
            </div>
        </div>

        <div class="form-group">
            <label class="col-sm-2 control-label">提交时间	</label>
            <div class="col-sm-10 content_div">
                {$detail.addtime|date="Y-m-d H:i:s",###}
            </div>
        </div>

        <div class="form-group">
            <label class="col-sm-2 control-label">回复</label>
            <div class="col-sm-11 content_div">
                <textarea id="content"  style="display: none;">{$detail.reply}</textarea>
            </div>
        </div>


    </form>
</div>

<div class="modal-footer">
    <button type="button" class="layui-btn layui-btn-primary js_cancel" close="true">关闭</button>
    <button type="button" class="layui-btn js_confirm" >回复</button>
<!--    <button type="button" class="btn btn-primary btn-sm" id="newsave" _event="add">保存</button>-->
</div>


<script>

    layui.use(['form','layedit','tree','util'], function() {
        var form = layui.form
            , layer = layui.layer;
        var layedit = layui.layedit;
        var  tree = layui.tree;
        var util = layui.util;

        layedit.set({
            uploadImage: {
                url: "{:URL('/common/upload/textUpload')}" //接口url
                ,type: '' //默认post
            }
        });
        var editIndex = layedit.build('content',{
            height: 120
        });

        $(".js_confirm").click(function () {
            var id = "{$detail.id}";
            var classify_id = "{$detail.classify_id}";

            var content = layedit.getContent(editIndex);
            $.ajax({
                type: "post",
                url: "{:URL('community/Message/reply')}",
                data: {id: id,content:content},
                dataType: "json",
                success: function (data) {
                    if (data.code == 0) {
                        $(".js_cancel").click();
                        window.location.href = "{:URL('community/message/index')}?classify_id="+classify_id;
                    }else{
                        layer.alert(data.msg);
                    }
                }
            });


        });

        layui.form.render('select');
        form.render();


    });
</script>

